﻿using System.Windows;
using System.Windows.Controls;

namespace StockholmsStad.Windows.UI.Modules.Couple.Controls
{
    /// <summary>
    /// Interaction logic for PersonDetailsControl.xaml
    /// </summary>
    public partial class PersonDetailsControl
    {
        public PersonDetailsControl()
        {
            InitializeComponent();
        }

        protected void CommonClickHandler(object sender, RoutedEventArgs e)
        {
            var element = e.Source as FrameworkElement;
        }

        protected void rbNationality_Checked(object sender, RoutedEventArgs e)
        {
            var rb = e.Source as RadioButton;

            if (rb != null && tbNationality != null)
            {
                if (rb.Content.Equals("Ja") && tbNationality.Visibility == Visibility.Hidden)
                    return;

                tbNationality.Visibility = tbNationality.Visibility == Visibility.Hidden
                                               ? Visibility.Visible
                                               : Visibility.Hidden;
            }
            //if (tbNationality.Visibility == Visibility.Hidden)
            //{
            //    rbNej.Content = "Nej";
            //    tbNationality.Width = 0;
            //}
            //else
            //{
            //    rbNej.Content = "Nej, Annat:";
            //    tbNationality.Width = 90;
            //}
        }
    }
}
